import { createRouter, createWebHistory } from 'vue-router'
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper'

export const constantRoutes = [
    //重定向--一般设置为首页
    {
        path: '/',
        redirect: '/vue3Home'
    },
    {
        path: '/vue3Home',
        component: () => import('@/views/Home/Home.vue')
    },
    {
        path: "/vue3About",
        component: () => import('@/views/About/About.vue')
    }
]

const router = createRouter({
    history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? '/vue3' : '/'),
    routes: [...constantRoutes]
})

export default router;